package com.rzz.overalldemo.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rzz.overalldemo.pojo.User;
import com.rzz.overalldemo.mapper.UserMapper;
import com.rzz.overalldemo.service.IUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author rzz
 * @since 2021-07-29
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public Object view(Long id) {
        return lambdaQuery().ne(User::getId,id).page(new Page<>(1,3));
    }

    @Override
    public Boolean add(User user) {
        return save(user);
    }

    @Override
    public Boolean updateUse(User user) {
        return updateById(user);
    }

    @Override
    public Boolean delete(Long id) {
        return removeById(id);
    }
}
